package com.loong.android.tools;

import android.content.Context;
import android.content.ClipboardManager;

/**
 * 剪贴板工具
 */
public class Clipboard {
    private static ClipboardManager clipboardManager;
    /**
     * 初始化剪贴板，返回剪贴板管理器
     * @param context 上下文
     */
    public static ClipboardManager init(Context context) {
        if(clipboardManager == null) {
            clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        }
        return clipboardManager;
    }

    public static ClipboardManager getClipboardManager() {
        return clipboardManager;
    }
}
